/**
 * Copyright (c) 2020-2021 浦东大爷 All rights reserved.
 * 机会永远都是留给有准备的人
 */
package com.lagou.service.impl;

import com.lagou.dao.CustomerDao;
import com.lagou.domain.Customer;
import com.lagou.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author: gitwo
 * @date: 2021-04-23
 * @description:
 */
@Service
public class CustomerServiceImpl implements CustomerService {

    @Autowired
    private CustomerDao customerDao;

    public List<Customer> findAll() {
        List<Customer> all = customerDao.findAll();
        return all;
    }

    public void save(Customer customer) {
        customer.setInputTime(new Date());
        customer.setCustomerManagerId(5);
        customerDao.save(customer);
    }

    public Customer findById(Integer id) {
        return customerDao.findById(id);
    }

    public void update(Customer customer) {
        customerDao.update(customer);
    }

    public void deleteBatch(Integer[] ids) {
        customerDao.deleteBatch(ids);
    }

    @Override
    public void deleteById(Integer id) {
        customerDao.deleteById(id);
    }


}
